<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加载测试数据</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <style>
        body {
            margin: 0;
            padding: 20px;
            font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
            background-color: #f5f5f5;
        }
        
        .container {
            max-width: 800px;
            margin: 0 auto;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
            padding: 30px;
        }
        
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .header h1 {
            color: #2c3e50;
            margin-bottom: 10px;
        }
        
        .data-info {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 30px;
            border-left: 4px solid #409eff;
        }
        
        .data-info h3 {
            margin-top: 0;
            color: #2c3e50;
        }
        
        .data-info ul {
            margin: 10px 0;
            padding-left: 20px;
        }
        
        .data-info li {
            margin-bottom: 5px;
            color: #666;
        }
        
        .action-buttons {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .action-buttons .el-button {
            margin: 0 10px;
        }
        
        .status {
            text-align: center;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        
        .status.success {
            background-color: #f0f9ff;
            border: 1px solid #67c23a;
            color: #67c23a;
        }
        
        .status.error {
            background-color: #fef0f0;
            border: 1px solid #f56c6c;
            color: #f56c6c;
        }
        
        .navigation {
            text-align: center;
            margin-top: 30px;
        }
        
        .navigation .el-button {
            margin: 0 10px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="container">
            <div class="header">
                <h1>📊 测试数据加载工具</h1>
                <p>用于加载人力资源需求规划表的测试数据</p>
            </div>
            
            <div class="data-info">
                <h3>📋 测试数据说明</h3>
                <ul>
                    <li><strong>填报人数量：</strong>5个用户（张三、李四、王五、赵六、孙七）</li>
                    <li><strong>有数据用户：</strong>4个（张三、李四、王五、赵六）</li>
                    <li><strong>空数据用户：</strong>1个（孙七，用于测试空数据情况）</li>
                    <li><strong>数据结构：</strong>新的扁平化结构格式</li>
                    <li><strong>Division：</strong>PTI</li>
                    <li><strong>BU：</strong>CP、CP2</li>
                    <li><strong>Function：</strong>维修、质量、生产</li>
                    <li><strong>Category：</strong>Permanent、Overtime、Temporary</li>
                    <li><strong>Responsible：</strong>每个记录都有负责人信息</li>
                    <li><strong>时间范围：</strong>1-12月，数据呈递增趋势</li>
                </ul>
            </div>
            
            <div class="action-buttons">
                <el-button type="primary" @click="loadTestData" icon="el-icon-upload">加载测试数据</el-button>
                <el-button type="warning" @click="clearAllData" icon="el-icon-delete">清空所有数据</el-button>
                <el-button type="info" @click="checkDataStatus" icon="el-icon-view">检查数据状态</el-button>
            </div>
            
            <div v-if="statusMessage" :class="['status', statusType]">
                {{ statusMessage }}
            </div>
            
            <div v-if="dataStatus" class="data-info">
                <h3>📊 当前数据状态</h3>
                <ul>
                    <li><strong>总用户数：</strong>{{ dataStatus.totalUsers }}</li>
                    <li><strong>有数据用户：</strong>{{ dataStatus.filledUsers }}</li>
                    <li><strong>空数据用户：</strong>{{ dataStatus.emptyUsers }}</li>
                    <li><strong>最后更新：</strong>{{ dataStatus.lastUpdate }}</li>
                </ul>
            </div>
            
            <div class="navigation">
                <el-button type="success" @click="goToSummary" icon="el-icon-view">查看汇总页面</el-button>
                <el-button type="primary" @click="goToIndex" icon="el-icon-edit">前往填报页面</el-button>
            </div>
        </div>
    </div>

    <!-- 引入Vue.js -->
    <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
    <!-- 引入Element UI -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    
    <script>
        // 测试数据 - 新的扁平化结构格式
        const testData = {
            "user_001": {
                "userId": "user_001",
                "userName": "张三",
                "lastUpdate": "2024-01-15T10:30:00.000Z",
                "tableData": [
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp001",
                            "code": "12345",
                            "name": "张三"
                        },
                        "1": 15,
                        "2": 16,
                        "3": 17,
                        "4": 18,
                        "5": 19,
                        "6": 20,
                        "7": 21,
                        "8": 22,
                        "9": 23,
                        "10": 24,
                        "11": 25,
                        "12": 26
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp002",
                            "code": "12346",
                            "name": "李四"
                        },
                        "1": 5,
                        "2": 6,
                        "3": 7,
                        "4": 8,
                        "5": 9,
                        "6": 10,
                        "7": 11,
                        "8": 12,
                        "9": 13,
                        "10": 14,
                        "11": 15,
                        "12": 16
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp003",
                            "code": "12347",
                            "name": "王五"
                        },
                        "1": 3,
                        "2": 4,
                        "3": 5,
                        "4": 6,
                        "5": 7,
                        "6": 8,
                        "7": 9,
                        "8": 10,
                        "9": 11,
                        "10": 12,
                        "11": 13,
                        "12": 14
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp004",
                            "code": "12348",
                            "name": "赵六"
                        },
                        "1": 12,
                        "2": 13,
                        "3": 14,
                        "4": 15,
                        "5": 16,
                        "6": 17,
                        "7": 18,
                        "8": 19,
                        "9": 20,
                        "10": 21,
                        "11": 22,
                        "12": 23
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp005",
                            "code": "12349",
                            "name": "孙七"
                        },
                        "1": 4,
                        "2": 5,
                        "3": 6,
                        "4": 7,
                        "5": 8,
                        "6": 9,
                        "7": 10,
                        "8": 11,
                        "9": 12,
                        "10": 13,
                        "11": 14,
                        "12": 15
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp006",
                            "code": "12350",
                            "name": "周八"
                        },
                        "1": 2,
                        "2": 3,
                        "3": 4,
                        "4": 5,
                        "5": 6,
                        "6": 7,
                        "7": 8,
                        "8": 9,
                        "9": 10,
                        "10": 11,
                        "11": 12,
                        "12": 13
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp007",
                            "code": "12351",
                            "name": "吴九"
                        },
                        "1": 25,
                        "2": 26,
                        "3": 27,
                        "4": 28,
                        "5": 29,
                        "6": 30,
                        "7": 31,
                        "8": 32,
                        "9": 33,
                        "10": 34,
                        "11": 35,
                        "12": 36
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp008",
                            "code": "12352",
                            "name": "郑十"
                        },
                        "1": 8,
                        "2": 9,
                        "3": 10,
                        "4": 11,
                        "5": 12,
                        "6": 13,
                        "7": 14,
                        "8": 15,
                        "9": 16,
                        "10": 17,
                        "11": 18,
                        "12": 19
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp009",
                            "code": "12353",
                            "name": "王十一"
                        },
                        "1": 6,
                        "2": 7,
                        "3": 8,
                        "4": 9,
                        "5": 10,
                        "6": 11,
                        "7": 12,
                        "8": 13,
                        "9": 14,
                        "10": 15,
                        "11": 16,
                        "12": 17
                    }
                ]
            },
            "user_002": {
                "userId": "user_002",
                "userName": "李四",
                "lastUpdate": "2024-01-16T14:20:00.000Z",
                "tableData": [
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp010",
                            "code": "12354",
                            "name": "李四"
                        },
                        "1": 18,
                        "2": 19,
                        "3": 20,
                        "4": 21,
                        "5": 22,
                        "6": 23,
                        "7": 24,
                        "8": 25,
                        "9": 26,
                        "10": 27,
                        "11": 28,
                        "12": 29
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp011",
                            "code": "12355",
                            "name": "李四"
                        },
                        "1": 7,
                        "2": 8,
                        "3": 9,
                        "4": 10,
                        "5": 11,
                        "6": 12,
                        "7": 13,
                        "8": 14,
                        "9": 15,
                        "10": 16,
                        "11": 17,
                        "12": 18
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp012",
                            "code": "12356",
                            "name": "李四"
                        },
                        "1": 4,
                        "2": 5,
                        "3": 6,
                        "4": 7,
                        "5": 8,
                        "6": 9,
                        "7": 10,
                        "8": 11,
                        "9": 12,
                        "10": 13,
                        "11": 14,
                        "12": 15
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp013",
                            "code": "12357",
                            "name": "李四"
                        },
                        "1": 14,
                        "2": 15,
                        "3": 16,
                        "4": 17,
                        "5": 18,
                        "6": 19,
                        "7": 20,
                        "8": 21,
                        "9": 22,
                        "10": 23,
                        "11": 24,
                        "12": 25
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp014",
                            "code": "12358",
                            "name": "李四"
                        },
                        "1": 5,
                        "2": 6,
                        "3": 7,
                        "4": 8,
                        "5": 9,
                        "6": 10,
                        "7": 11,
                        "8": 12,
                        "9": 13,
                        "10": 14,
                        "11": 15,
                        "12": 16
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp015",
                            "code": "12359",
                            "name": "李四"
                        },
                        "1": 3,
                        "2": 4,
                        "3": 5,
                        "4": 6,
                        "5": 7,
                        "6": 8,
                        "7": 9,
                        "8": 10,
                        "9": 11,
                        "10": 12,
                        "11": 13,
                        "12": 14
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp016",
                            "code": "12360",
                            "name": "李四"
                        },
                        "1": 28,
                        "2": 29,
                        "3": 30,
                        "4": 31,
                        "5": 32,
                        "6": 33,
                        "7": 34,
                        "8": 35,
                        "9": 36,
                        "10": 37,
                        "11": 38,
                        "12": 39
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp017",
                            "code": "12361",
                            "name": "李四"
                        },
                        "1": 10,
                        "2": 11,
                        "3": 12,
                        "4": 13,
                        "5": 14,
                        "6": 15,
                        "7": 16,
                        "8": 17,
                        "9": 18,
                        "10": 19,
                        "11": 20,
                        "12": 21
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp018",
                            "code": "12362",
                            "name": "李四"
                        },
                        "1": 7,
                        "2": 8,
                        "3": 9,
                        "4": 10,
                        "5": 11,
                        "6": 12,
                        "7": 13,
                        "8": 14,
                        "9": 15,
                        "10": 16,
                        "11": 17,
                        "12": 18
                    }
                ]
            },
            "user_003": {
                "userId": "user_003",
                "userName": "王五",
                "lastUpdate": "2024-01-17T09:15:00.000Z",
                "tableData": [
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp019",
                            "code": "12363",
                            "name": "王五"
                        },
                        "1": 20,
                        "2": 21,
                        "3": 22,
                        "4": 23,
                        "5": 24,
                        "6": 25,
                        "7": 26,
                        "8": 27,
                        "9": 28,
                        "10": 29,
                        "11": 30,
                        "12": 31
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp020",
                            "code": "12364",
                            "name": "王五"
                        },
                        "1": 8,
                        "2": 9,
                        "3": 10,
                        "4": 11,
                        "5": 12,
                        "6": 13,
                        "7": 14,
                        "8": 15,
                        "9": 16,
                        "10": 17,
                        "11": 18,
                        "12": 19
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp021",
                            "code": "12365",
                            "name": "王五"
                        },
                        "1": 5,
                        "2": 6,
                        "3": 7,
                        "4": 8,
                        "5": 9,
                        "6": 10,
                        "7": 11,
                        "8": 12,
                        "9": 13,
                        "10": 14,
                        "11": 15,
                        "12": 16
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp022",
                            "code": "12366",
                            "name": "王五"
                        },
                        "1": 16,
                        "2": 17,
                        "3": 18,
                        "4": 19,
                        "5": 20,
                        "6": 21,
                        "7": 22,
                        "8": 23,
                        "9": 24,
                        "10": 25,
                        "11": 26,
                        "12": 27
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp023",
                            "code": "12367",
                            "name": "王五"
                        },
                        "1": 6,
                        "2": 7,
                        "3": 8,
                        "4": 9,
                        "5": 10,
                        "6": 11,
                        "7": 12,
                        "8": 13,
                        "9": 14,
                        "10": 15,
                        "11": 16,
                        "12": 17
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp024",
                            "code": "12368",
                            "name": "王五"
                        },
                        "1": 4,
                        "2": 5,
                        "3": 6,
                        "4": 7,
                        "5": 8,
                        "6": 9,
                        "7": 10,
                        "8": 11,
                        "9": 12,
                        "10": 13,
                        "11": 14,
                        "12": 15
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp025",
                            "code": "12369",
                            "name": "王五"
                        },
                        "1": 30,
                        "2": 31,
                        "3": 32,
                        "4": 33,
                        "5": 34,
                        "6": 35,
                        "7": 36,
                        "8": 37,
                        "9": 38,
                        "10": 39,
                        "11": 40,
                        "12": 41
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp026",
                            "code": "12370",
                            "name": "王五"
                        },
                        "1": 12,
                        "2": 13,
                        "3": 14,
                        "4": 15,
                        "5": 16,
                        "6": 17,
                        "7": 18,
                        "8": 19,
                        "9": 20,
                        "10": 21,
                        "11": 22,
                        "12": 23
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp027",
                            "code": "12371",
                            "name": "王五"
                        },
                        "1": 8,
                        "2": 9,
                        "3": 10,
                        "4": 11,
                        "5": 12,
                        "6": 13,
                        "7": 14,
                        "8": 15,
                        "9": 16,
                        "10": 17,
                        "11": 18,
                        "12": 19
                    }
                ]
            },
            "user_004": {
                "userId": "user_004",
                "userName": "赵六",
                "lastUpdate": "2024-01-18T16:45:00.000Z",
                "tableData": [
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp028",
                            "code": "12372",
                            "name": "赵六"
                        },
                        "1": 22,
                        "2": 23,
                        "3": 24,
                        "4": 25,
                        "5": 26,
                        "6": 27,
                        "7": 28,
                        "8": 29,
                        "9": 30,
                        "10": 31,
                        "11": 32,
                        "12": 33
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp029",
                            "code": "12373",
                            "name": "赵六"
                        },
                        "1": 9,
                        "2": 10,
                        "3": 11,
                        "4": 12,
                        "5": 13,
                        "6": 14,
                        "7": 15,
                        "8": 16,
                        "9": 17,
                        "10": 18,
                        "11": 19,
                        "12": 20
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "维修",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp030",
                            "code": "12374",
                            "name": "赵六"
                        },
                        "1": 6,
                        "2": 7,
                        "3": 8,
                        "4": 9,
                        "5": 10,
                        "6": 11,
                        "7": 12,
                        "8": 13,
                        "9": 14,
                        "10": 15,
                        "11": 16,
                        "12": 17
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp031",
                            "code": "12375",
                            "name": "赵六"
                        },
                        "1": 18,
                        "2": 19,
                        "3": 20,
                        "4": 21,
                        "5": 22,
                        "6": 23,
                        "7": 24,
                        "8": 25,
                        "9": 26,
                        "10": 27,
                        "11": 28,
                        "12": 29
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp032",
                            "code": "12376",
                            "name": "赵六"
                        },
                        "1": 7,
                        "2": 8,
                        "3": 9,
                        "4": 10,
                        "5": 11,
                        "6": 12,
                        "7": 13,
                        "8": 14,
                        "9": 15,
                        "10": 16,
                        "11": 17,
                        "12": 18
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp1",
                            "name": "CP",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "质量",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp033",
                            "code": "12377",
                            "name": "赵六"
                        },
                        "1": 5,
                        "2": 6,
                        "3": 7,
                        "4": 8,
                        "5": 9,
                        "6": 10,
                        "7": 11,
                        "8": 12,
                        "9": 13,
                        "10": 14,
                        "11": 15,
                        "12": 16
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Permanent",
                        "responsible": {
                            "id": "emp034",
                            "code": "12378",
                            "name": "赵六"
                        },
                        "1": 32,
                        "2": 33,
                        "3": 34,
                        "4": 35,
                        "5": 36,
                        "6": 37,
                        "7": 38,
                        "8": 39,
                        "9": 40,
                        "10": 41,
                        "11": 42,
                        "12": 43
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Overtime",
                        "responsible": {
                            "id": "emp035",
                            "code": "12379",
                            "name": "赵六"
                        },
                        "1": 14,
                        "2": 15,
                        "3": 16,
                        "4": 17,
                        "5": 18,
                        "6": 19,
                        "7": 20,
                        "8": 21,
                        "9": 22,
                        "10": 23,
                        "11": 24,
                        "12": 25
                    },
                    {
                        "bu": {
                            "id": "bu-pti-cp2",
                            "name": "CP2",
                            "division": {
                                "id": "div-pti",
                                "name": "PTI"
                            }
                        },
                        "function": "生产",
                        "category": "Temporary",
                        "responsible": {
                            "id": "emp036",
                            "code": "12380",
                            "name": "赵六"
                        },
                        "1": 10,
                        "2": 11,
                        "3": 12,
                        "4": 13,
                        "5": 14,
                        "6": 15,
                        "7": 16,
                        "8": 17,
                        "9": 18,
                        "10": 19,
                        "11": 20,
                        "12": 21
                    }
                ]
            },
            "user_005": {
                "userId": "user_005",
                "userName": "孙七",
                "lastUpdate": "2024-01-19T11:30:00.000Z",
                "tableData": []
            }
        };

        new Vue({
            el: '#app',
            data() {
                return {
                    statusMessage: '',
                    statusType: 'success',
                    dataStatus: null
                }
            },
            
            mounted() {
                this.checkDataStatus();
            },
            
            methods: {
                loadTestData() {
                    try {
                        localStorage.setItem('allUsersData', JSON.stringify(testData));
                        this.statusMessage = '✅ 测试数据加载成功！包含5个用户的扁平化格式数据。';
                        this.statusType = 'success';
                        this.checkDataStatus();
                        this.$message.success('测试数据已成功加载到localStorage');
                    } catch (error) {
                        this.statusMessage = '❌ 加载测试数据失败：' + error.message;
                        this.statusType = 'error';
                        this.$message.error('加载测试数据失败');
                    }
                },
                
                clearAllData() {
                    this.$confirm('确定要清空所有数据吗？此操作不可恢复！', '清空确认', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        localStorage.removeItem('allUsersData');
                        localStorage.removeItem('hrTableData');
                        this.statusMessage = '🗑️ 所有数据已清空';
                        this.statusType = 'success';
                        this.dataStatus = null;
                        this.$message.success('所有数据已清空');
                    }).catch(() => {
                        this.$message.info('已取消清空');
                    });
                },
                
                checkDataStatus() {
                    try {
                        const allData = localStorage.getItem('allUsersData');
                        if (allData) {
                            const data = JSON.parse(allData);
                            const users = Object.values(data);
                            const filledUsers = users.filter(user => user.tableData && user.tableData.length > 0);
                            const emptyUsers = users.filter(user => !user.tableData || user.tableData.length === 0);
                            
                            this.dataStatus = {
                                totalUsers: users.length,
                                filledUsers: filledUsers.length,
                                emptyUsers: emptyUsers.length,
                                lastUpdate: users.length > 0 ? this.formatDate(users[0].lastUpdate) : '无'
                            };
                            
                            this.statusMessage = `📊 当前数据状态：${users.length}个用户，${filledUsers.length}个有数据，${emptyUsers.length}个空数据`;
                            this.statusType = 'success';
                        } else {
                            this.statusMessage = '📭 当前没有数据';
                            this.statusType = 'error';
                            this.dataStatus = null;
                        }
                    } catch (error) {
                        this.statusMessage = '❌ 检查数据状态失败：' + error.message;
                        this.statusType = 'error';
                        this.dataStatus = null;
                    }
                },
                
                goToSummary() {
                    window.open('summary.html', '_blank');
                },
                
                goToIndex() {
                    window.open('index.html', '_blank');
                },
                
                formatDate(dateString) {
                    if (!dateString) return '未知';
                    const date = new Date(dateString);
                    const year = date.getFullYear();
                    const month = String(date.getMonth() + 1).padStart(2, '0');
                    const day = String(date.getDate()).padStart(2, '0');
                    const hours = String(date.getHours()).padStart(2, '0');
                    const minutes = String(date.getMinutes()).padStart(2, '0');
                    return `${year}-${month}-${day} ${hours}:${minutes}`;
                }
            }
        });
    </script>
</body>
</html> 